package com.itheima.TestFinall;


import java.lang.reflect.Method;
import java.util.Properties;

public class Demo {
    public static void main(String[] args) throws Exception{

        /*Properties pro = new Properties();

        pro.load(Demo.class.getClassLoader().getResourceAsStream("333.properties"));

        Class clazz = Class.forName(pro.getProperty("classname"));

        Method method = clazz.getDeclaredMethod(pro.getProperty("methodname"));
        Method methodname2 = clazz.getDeclaredMethod(pro.getProperty("methodname2"));

        method.setAccessible(true);
        methodname2.setAccessible(true);

        Object o = clazz.newInstance();
        method.invoke(o);
        methodname2.invoke(o);*/

        Properties pro  = new Properties();
        pro.load(Demo.class.getClassLoader().getResourceAsStream("333.properties"));

        Class clazz = Class.forName(pro.getProperty("classname"));
        Method method = clazz.getDeclaredMethod(pro.getProperty("methodname"));
        Method method2 = clazz.getDeclaredMethod(pro.getProperty("methodname2"));

        method.setAccessible(true);
        method2.setAccessible(true);

        Object o = clazz.newInstance();
        method.invoke(o);
        method2.invoke(o);

    }
}
